package com.soft.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

//该servlet的映射路径配置到web.xml里，它和@webServlet起到相同的作用
public class HelloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //响应，直接输出响应结果
        PrintWriter out = resp.getWriter();
        out.println("hello world!");
    }
}
